.class public Lcom/nemustech/tiffany/world/TFFlexiblePanel;
.super Lcom/nemustech/tiffany/world/TFModel;
.source "TFFlexiblePanel.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/nemustech/tiffany/world/TFFlexiblePanel$Bezier3DPointBlender;,
        Lcom/nemustech/tiffany/world/TFFlexiblePanel$IdentityPointBlender;,
        Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;
    }
.end annotation


# static fields
.field public static final N:I = 0x8

.field static final TAG:Ljava/lang/String; = "TFFlexiblePanel"


# instance fields
.field protected XYZ:[F

.field private mDrawReflection:Z

.field private mImageOrientation:[I

.field protected mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

.field protected mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

.field protected mPointBlenderChanged:Z

.field private mReverseWay:[I


# direct methods
.method public constructor <init>()V
    .locals 2

    .prologue
    const/4 v0, 0x0

    const/high16 v1, 0x3f80

    .line 18
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 505
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 506
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 507
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 509
    const/4 v0, 0x3

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->XYZ:[F

    .line 511
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 19
    invoke-direct {p0, v1, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->create(FF)V

    .line 20
    return-void
.end method

.method public constructor <init>(FF)V
    .locals 1
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v0, 0x0

    .line 28
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 505
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 506
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 507
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 509
    const/4 v0, 0x3

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->XYZ:[F

    .line 511
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 29
    invoke-direct {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->create(FF)V

    .line 30
    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFHolder;FF)V
    .locals 1
    .parameter "holder"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v0, 0x0

    .line 53
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 505
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 506
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 507
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 509
    const/4 v0, 0x3

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->XYZ:[F

    .line 511
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 54
    invoke-direct {p0, p2, p3}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->create(FF)V

    .line 55
    invoke-super {p0, p1}, Lcom/nemustech/tiffany/world/TFModel;->attachTo(Lcom/nemustech/tiffany/world/TFHolder;)V

    .line 56
    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;FF)V
    .locals 1
    .parameter "world"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v0, 0x0

    .line 40
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFModel;-><init>()V

    .line 505
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 506
    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 507
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 509
    const/4 v0, 0x3

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->XYZ:[F

    .line 511
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 41
    invoke-direct {p0, p2, p3}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->create(FF)V

    .line 42
    invoke-super {p0, p1}, Lcom/nemustech/tiffany/world/TFModel;->attachTo(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 43
    return-void
.end method

.method private checkPoints(Ljava/nio/FloatBuffer;)Z
    .locals 7
    .parameter "vertex"

    .prologue
    const/4 v6, 0x1

    .line 422
    const/4 v2, 0x1

    .line 424
    .local v2, ret:Z
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    if-nez v5, :cond_0

    move v3, v2

    .line 442
    .end local v2           #ret:Z
    .local v3, ret:I
    :goto_0
    return v3

    .line 426
    .end local v3           #ret:I
    .restart local v2       #ret:Z
    :cond_0
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-boolean v5, v5, Lcom/nemustech/tiffany/world/TFWorld;->mReflection:Z

    if-eqz v5, :cond_2

    .line 429
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mLocation:[F

    aget v1, v5, v6

    .line 430
    .local v1, objectY:F
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v5, :cond_1

    .line 431
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    iget-object v5, v5, Lcom/nemustech/tiffany/world/TFHolder;->mLocation:[F

    aget v5, v5, v6

    add-float/2addr v1, v5

    .line 434
    :cond_1
    const/4 v0, 0x0

    .local v0, i:I
    :goto_1
    const/16 v5, 0x90

    if-ge v0, v5, :cond_2

    .line 435
    mul-int/lit8 v5, v0, 0x3

    add-int/lit8 v5, v5, 0x1

    invoke-virtual {p1, v5}, Ljava/nio/FloatBuffer;->get(I)F

    move-result v5

    add-float v4, v5, v1

    .line 436
    .local v4, y:F
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget v5, v5, Lcom/nemustech/tiffany/world/TFWorld;->mReflectingFloor:F

    cmpg-float v5, v4, v5

    if-gez v5, :cond_3

    .line 437
    const/4 v2, 0x0

    .end local v0           #i:I
    .end local v1           #objectY:F
    .end local v4           #y:F
    :cond_2
    move v3, v2

    .line 442
    .restart local v3       #ret:I
    goto :goto_0

    .line 434
    .end local v3           #ret:I
    .restart local v0       #i:I
    .restart local v1       #objectY:F
    .restart local v4       #y:F
    :cond_3
    add-int/lit8 v0, v0, 0x1

    goto :goto_1
.end method

.method private create(FF)V
    .locals 2
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v1, 0x2

    .line 59
    new-array v0, v1, [I

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mImageOrientation:[I

    .line 60
    new-array v0, v1, [I

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mReverseWay:[I

    .line 61
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->setSize(FF)V

    .line 62
    const/4 v0, 0x1

    invoke-super {p0, v0}, Lcom/nemustech/tiffany/world/TFModel;->setBackFaceVisibility(Z)V

    .line 63
    return-void
.end method

.method private fillTexCoord(Ljava/nio/FloatBuffer;)V
    .locals 3
    .parameter "texCoord"

    .prologue
    const/4 v2, 0x0

    const/high16 v1, 0x3f80

    .line 416
    invoke-direct {p0, p1, v2, v1, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V

    .line 417
    const/4 v0, 0x1

    invoke-direct {p0, p1, v0, v1, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V

    .line 418
    invoke-virtual {p1, v2}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 419
    return-void
.end method

.method private fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V
    .locals 11
    .parameter "texCoord"
    .parameter "face"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 367
    move v8, p3

    .line 368
    .local v8, w:F
    move v0, p4

    .line 369
    .local v0, h:F
    mul-int/lit8 v9, p2, 0x8

    mul-int/lit8 v9, v9, 0x9

    mul-int/lit8 v9, v9, 0x2

    mul-int/lit8 v3, v9, 0x2

    .line 370
    .local v3, offset:I
    iget-object v9, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mReverseWay:[I

    aget v4, v9, p2

    .line 372
    .local v4, reverse:I
    invoke-virtual {p1, v3}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 373
    const/4 v2, 0x0

    .local v2, j:I
    :goto_0
    const/16 v9, 0x8

    if-ge v2, v9, :cond_1

    .line 374
    int-to-float v9, v2

    const/high16 v10, 0x4100

    div-float v6, v9, v10

    .line 375
    .local v6, t1:F
    add-int/lit8 v9, v2, 0x1

    int-to-float v9, v9

    const/high16 v10, 0x4100

    div-float v7, v9, v10

    .line 376
    .local v7, t2:F
    const/4 v1, 0x0

    .local v1, i:I
    :goto_1
    const/16 v9, 0x8

    if-gt v1, v9, :cond_0

    .line 377
    int-to-float v9, v1

    const/high16 v10, 0x4100

    div-float v5, v9, v10

    .line 378
    .local v5, s:F
    packed-switch v4, :pswitch_data_0

    .line 381
    mul-float v9, v5, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 382
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v7

    mul-float/2addr v9, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 383
    mul-float v9, v5, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 384
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v6

    mul-float/2addr v9, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 376
    :goto_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 387
    :pswitch_0
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v5

    mul-float/2addr v9, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 388
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v7

    mul-float/2addr v9, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 389
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v5

    mul-float/2addr v9, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 390
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v6

    mul-float/2addr v9, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    goto :goto_2

    .line 393
    :pswitch_1
    mul-float v9, v5, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 394
    mul-float v9, v7, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 395
    mul-float v9, v5, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 396
    mul-float v9, v6, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    goto :goto_2

    .line 399
    :pswitch_2
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v5

    mul-float/2addr v9, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 400
    mul-float v9, v7, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 401
    const/high16 v9, 0x3f80

    sub-float/2addr v9, v5

    mul-float/2addr v9, v8

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 402
    mul-float v9, v6, v0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    goto :goto_2

    .line 373
    .end local v5           #s:F
    :cond_0
    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_0

    .line 407
    .end local v1           #i:I
    .end local v6           #t1:F
    .end local v7           #t2:F
    :cond_1
    const/4 v9, 0x0

    invoke-virtual {p1, v9}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 408
    return-void

    .line 378
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method private fillVertex(Ljava/nio/FloatBuffer;)V
    .locals 4
    .parameter "vertex"

    .prologue
    const/4 v3, 0x0

    .line 411
    iget v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWidth:F

    iget v1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHeight:F

    invoke-direct {p0, p1, v3, v0, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillVertexFace(Ljava/nio/FloatBuffer;IFF)V

    .line 412
    const/4 v0, 0x1

    iget v1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWidth:F

    iget v2, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHeight:F

    invoke-direct {p0, p1, v0, v1, v2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillVertexFace(Ljava/nio/FloatBuffer;IFF)V

    .line 413
    invoke-virtual {p1, v3}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 414
    return-void
.end method

.method private fillVertexFace(Ljava/nio/FloatBuffer;IFF)V
    .locals 10
    .parameter "vertex"
    .parameter "face"
    .parameter "width"
    .parameter "height"

    .prologue
    .line 324
    mul-int/lit8 v7, p2, 0x8

    mul-int/lit8 v7, v7, 0x9

    mul-int/lit8 v7, v7, 0x2

    mul-int/lit8 v4, v7, 0x3

    .line 325
    .local v4, offset:I
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->XYZ:[F

    .line 326
    .local v0, coord:[F
    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 327
    .local v5, pb:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;
    move v6, p3

    .line 328
    .local v6, w:F
    move v1, p4

    .line 330
    .local v1, h:F
    invoke-virtual {p1, v4}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 331
    if-nez v5, :cond_1

    .line 333
    const/4 v7, 0x2

    const/4 v8, 0x0

    aput v8, v0, v7

    .line 334
    const/4 v3, 0x0

    .local v3, j:I
    :goto_0
    const/16 v7, 0x8

    if-ge v3, v7, :cond_3

    .line 335
    const/4 v2, 0x0

    .local v2, i:I
    :goto_1
    const/16 v7, 0x8

    if-gt v2, v7, :cond_0

    .line 336
    const/4 v7, 0x0

    int-to-float v8, v2

    const/high16 v9, 0x4100

    div-float/2addr v8, v9

    aput v8, v0, v7

    .line 337
    const/4 v7, 0x1

    add-int/lit8 v8, v3, 0x1

    int-to-float v8, v8

    const/high16 v9, 0x4100

    div-float/2addr v8, v9

    aput v8, v0, v7

    .line 338
    const/4 v7, 0x0

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v6

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 339
    const/4 v7, 0x1

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v1

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 340
    const/4 v7, 0x2

    aget v7, v0, v7

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 343
    const/4 v7, 0x1

    add-int/lit8 v8, v3, 0x0

    int-to-float v8, v8

    const/high16 v9, 0x4100

    div-float/2addr v8, v9

    aput v8, v0, v7

    .line 344
    const/4 v7, 0x0

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v6

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 345
    const/4 v7, 0x1

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v1

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 346
    const/4 v7, 0x2

    aget v7, v0, v7

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 335
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 334
    :cond_0
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 351
    .end local v2           #i:I
    .end local v3           #j:I
    :cond_1
    const/4 v3, 0x0

    .restart local v3       #j:I
    :goto_2
    const/16 v7, 0x8

    if-ge v3, v7, :cond_3

    .line 352
    const/4 v2, 0x0

    .restart local v2       #i:I
    :goto_3
    const/16 v7, 0x8

    if-gt v2, v7, :cond_2

    .line 353
    add-int/lit8 v7, v3, 0x1

    invoke-interface {v5, v2, v7, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->calcXYZ(II[F)V

    .line 354
    const/4 v7, 0x0

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v6

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 355
    const/4 v7, 0x1

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v1

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 356
    const/4 v7, 0x2

    aget v7, v0, v7

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 357
    invoke-interface {v5, v2, v3, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->calcXYZ(II[F)V

    .line 358
    const/4 v7, 0x0

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v6

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 359
    const/4 v7, 0x1

    aget v7, v0, v7

    const/high16 v8, 0x3f00

    sub-float/2addr v7, v8

    mul-float/2addr v7, v1

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 360
    const/4 v7, 0x2

    aget v7, v0, v7

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->put(F)Ljava/nio/FloatBuffer;

    .line 352
    add-int/lit8 v2, v2, 0x1

    goto :goto_3

    .line 351
    :cond_2
    add-int/lit8 v3, v3, 0x1

    goto :goto_2

    .line 364
    .end local v2           #i:I
    :cond_3
    const/4 v7, 0x0

    invoke-virtual {p1, v7}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 365
    return-void
.end method


# virtual methods
.method adjustTextureCoordination(Landroid/graphics/Rect;III)V
    .locals 4
    .parameter "rectTexture"
    .parameter "index"
    .parameter "textureWidth"
    .parameter "textureHeight"

    .prologue
    .line 137
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    iget v1, p1, Landroid/graphics/Rect;->right:I

    int-to-float v1, v1

    int-to-float v2, p3

    div-float/2addr v1, v2

    iget v2, p1, Landroid/graphics/Rect;->bottom:I

    int-to-float v2, v2

    int-to-float v3, p4

    div-float/2addr v2, v3

    invoke-direct {p0, v0, p2, v1, v2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V

    .line 140
    return-void
.end method

.method protected drawVertex(Ljavax/microedition/khronos/opengles/GL10;I)V
    .locals 5
    .parameter "gl"
    .parameter "face"

    .prologue
    .line 318
    mul-int/lit8 v2, p2, 0x8

    mul-int/lit8 v2, v2, 0x9

    mul-int/lit8 v1, v2, 0x2

    .line 319
    .local v1, offset:I
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    const/16 v2, 0x8

    if-ge v0, v2, :cond_0

    .line 320
    const/4 v2, 0x5

    mul-int/lit8 v3, v0, 0x9

    mul-int/lit8 v3, v3, 0x2

    add-int/2addr v3, v1

    const/16 v4, 0x12

    invoke-interface {p1, v2, v3, v4}, Ljavax/microedition/khronos/opengles/GL10;->glDrawArrays(III)V

    .line 319
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 321
    :cond_0
    return-void
.end method

.method protected isInEffectAnimation()Z
    .locals 1

    .prologue
    .line 144
    invoke-super {p0}, Lcom/nemustech/tiffany/world/TFModel;->isInEffectAnimation()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    if-eqz v0, :cond_1

    :cond_0
    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected onDrawVertex(Ljavax/microedition/khronos/opengles/GL10;IZ)V
    .locals 0
    .parameter "gl"
    .parameter "faceIndex"
    .parameter "reflection"

    .prologue
    .line 175
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->drawVertex(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 176
    return-void
.end method

.method public reverseImage(II)V
    .locals 2
    .parameter "index"
    .parameter "reverseWay"

    .prologue
    const/high16 v1, 0x3f80

    .line 91
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mReverseWay:[I

    aget v0, v0, p1

    if-ne v0, p2, :cond_0

    .line 96
    :goto_0
    return-void

    .line 94
    :cond_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mReverseWay:[I

    aput p2, v0, p1

    .line 95
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0, p1, v1, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V

    goto :goto_0
.end method

.method public setImageDirection(II)V
    .locals 2
    .parameter "index"
    .parameter "direction"

    .prologue
    const/high16 v1, 0x3f80

    .line 74
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mImageOrientation:[I

    aget v0, v0, p1

    if-ne v0, p2, :cond_0

    .line 80
    :goto_0
    return-void

    .line 77
    :cond_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mImageOrientation:[I

    aput p2, v0, p1

    .line 79
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0, p1, v1, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoordFace(Ljava/nio/FloatBuffer;IFF)V

    goto :goto_0
.end method

.method public setPointBlender(Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;)V
    .locals 1
    .parameter "pb"

    .prologue
    .line 311
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 312
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 313
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 314
    return-void
.end method

.method public setSize(FF)V
    .locals 5
    .parameter "width"
    .parameter "height"

    .prologue
    .line 153
    iput p1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWidth:F

    .line 154
    iput p2, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHeight:F

    .line 157
    const/16 v0, 0x90

    .line 158
    .local v0, bufSize:I
    mul-int/lit8 v0, v0, 0x2

    .line 159
    mul-int/lit8 v3, v0, 0x3

    mul-int/lit8 v3, v3, 0x4

    invoke-static {v3}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v3

    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v2

    .line 162
    .local v2, vertex:Ljava/nio/FloatBuffer;
    invoke-direct {p0, v2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillVertex(Ljava/nio/FloatBuffer;)V

    .line 163
    invoke-direct {p0, v2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->checkPoints(Ljava/nio/FloatBuffer;)Z

    move-result v3

    iput-boolean v3, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 164
    iput-object v2, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    .line 166
    mul-int/lit8 v3, v0, 0x2

    mul-int/lit8 v3, v3, 0x4

    invoke-static {v3}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;

    move-result-object v3

    invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;

    move-result-object v3

    invoke-virtual {v3}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;

    move-result-object v1

    .line 169
    .local v1, texCoord:Ljava/nio/FloatBuffer;
    invoke-direct {p0, v1}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillTexCoord(Ljava/nio/FloatBuffer;)V

    .line 170
    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mTextureBuffer:Ljava/nio/FloatBuffer;

    .line 171
    return-void
.end method

.method updateHitPoint()V
    .locals 22

    .prologue
    .line 451
    invoke-super/range {p0 .. p0}, Lcom/nemustech/tiffany/world/TFModel;->updateHitPoint()V

    .line 453
    const/16 v15, 0x1b0

    .line 454
    .local v15, hitPointOffset:I
    const/16 v20, 0x1b4

    .line 455
    .local v20, uvtOffset:I
    const/16 v21, 0x1b7

    .line 456
    .local v21, workOffset:I
    const/16 v6, 0x1d7

    new-array v2, v6, [F

    .line 458
    .local v2, work:[F
    const/high16 v19, 0x7f80

    .line 460
    .local v19, tMin:F
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    move-object v6, v0

    const/4 v7, 0x0

    invoke-virtual {v6, v7}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 461
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    move-object v6, v0

    const/4 v7, 0x0

    const/16 v8, 0x1b0

    invoke-virtual {v6, v2, v7, v8}, Ljava/nio/FloatBuffer;->get([FII)Ljava/nio/FloatBuffer;

    .line 462
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    move-object v6, v0

    const/4 v7, 0x0

    invoke-virtual {v6, v7}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;

    .line 464
    const/16 v16, 0x0

    .local v16, i:I
    :goto_0
    const/16 v6, 0x8

    move/from16 v0, v16

    move v1, v6

    if-ge v0, v1, :cond_3

    .line 465
    mul-int/lit8 v6, v16, 0x9

    mul-int/lit8 v18, v6, 0x2

    .line 466
    .local v18, row:I
    const/16 v17, 0x0

    .local v17, j:I
    :goto_1
    const/16 v6, 0x10

    move/from16 v0, v17

    move v1, v6

    if-ge v0, v1, :cond_2

    .line 467
    add-int v6, v18, v17

    add-int/lit8 v6, v6, 0x0

    mul-int/lit8 v3, v6, 0x3

    .line 468
    .local v3, a:I
    add-int v6, v18, v17

    add-int/lit8 v6, v6, 0x1

    mul-int/lit8 v4, v6, 0x3

    .line 469
    .local v4, b:I
    add-int v6, v18, v17

    add-int/lit8 v6, v6, 0x2

    mul-int/lit8 v5, v6, 0x3

    .line 470
    .local v5, c:I
    rem-int/lit8 v6, v17, 0x2

    if-eqz v6, :cond_0

    .line 472
    move v13, v4

    .line 473
    .local v13, d:I
    move v4, v5

    .line 474
    move v5, v13

    .line 476
    .end local v13           #d:I
    :cond_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitTestLine:[F

    move-object v6, v0

    const/16 v8, 0x1b0

    const/16 v10, 0x1b4

    const/16 v12, 0x1b7

    move-object v7, v2

    move-object v9, v2

    move-object v11, v2

    invoke-static/range {v2 .. v12}, Lcom/nemustech/tiffany/world/TFModel;->doHitTestVertexTrigangle([FIII[F[FI[FI[FI)I

    move-result v14

    .line 482
    .local v14, hit:I
    if-ltz v14, :cond_1

    const/16 v6, 0x1b6

    aget v6, v2, v6

    cmpl-float v6, v19, v6

    if-ltz v6, :cond_1

    .line 483
    const/16 v6, 0x1b6

    aget v19, v2, v6

    .line 484
    move v0, v14

    move-object/from16 v1, p0

    iput v0, v1, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitFace:I

    .line 485
    const/16 v6, 0x1b0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitPoint:[F

    move-object v7, v0

    const/4 v8, 0x0

    const/4 v9, 0x4

    invoke-static {v2, v6, v7, v8, v9}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 466
    :cond_1
    add-int/lit8 v17, v17, 0x1

    goto :goto_1

    .line 464
    .end local v3           #a:I
    .end local v4           #b:I
    .end local v5           #c:I
    .end local v14           #hit:I
    :cond_2
    add-int/lit8 v16, v16, 0x1

    goto :goto_0

    .line 489
    .end local v17           #j:I
    .end local v18           #row:I
    :cond_3
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitFace:I

    move v6, v0

    if-ltz v6, :cond_4

    .line 490
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitPoint:[F

    move-object v6, v0

    const/4 v7, 0x0

    invoke-static {v6, v7}, Lcom/nemustech/tiffany/world/TFVector3D;->setW([FI)V

    .line 491
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitPoint:[F

    move-object v6, v0

    const/4 v7, 0x4

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mMatrix:[F

    move-object v8, v0

    const/4 v9, 0x0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mHitPoint:[F

    move-object v10, v0

    const/4 v11, 0x0

    invoke-static/range {v6 .. v11}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 494
    :cond_4
    return-void
.end method

.method protected updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z
    .locals 4
    .parameter "gl"
    .parameter "tickPassed"
    .parameter "bDoGLCalc"

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

    const/4 v1, 0x0

    .line 100
    invoke-super {p0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFModel;->updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z

    move-result v0

    if-nez v0, :cond_0

    move v0, v1

    .line 132
    :goto_0
    return v0

    .line 103
    :cond_0
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    if-eqz v0, :cond_1

    .line 104
    iput-boolean v1, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlenderChanged:Z

    .line 106
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    if-nez v0, :cond_4

    .line 108
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillVertex(Ljava/nio/FloatBuffer;)V

    .line 109
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->checkPoints(Ljava/nio/FloatBuffer;)Z

    move-result v0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 113
    :goto_1
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 114
    iput-object v3, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mNewPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 115
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    if-eqz v0, :cond_1

    .line 116
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    invoke-interface {v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->onStart()V

    .line 118
    :cond_1
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    if-eqz v0, :cond_3

    .line 119
    iput v2, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mEffectStatus:I

    .line 120
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 122
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    invoke-interface {v0, p2}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->onFrame(I)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 123
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->fillVertex(Ljava/nio/FloatBuffer;)V

    .line 124
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-direct {p0, v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->checkPoints(Ljava/nio/FloatBuffer;)Z

    move-result v0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mDrawReflection:Z

    .line 126
    :cond_2
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    invoke-interface {v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->isNextAvailable()Z

    move-result v0

    if-nez v0, :cond_3

    .line 127
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    invoke-interface {v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->onEnd()V

    .line 128
    iput-object v3, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    .line 129
    const/4 v0, 0x2

    iput v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mEffectStatus:I

    :cond_3
    move v0, v2

    .line 132
    goto :goto_0

    .line 112
    :cond_4
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFFlexiblePanel;->mPointBlender:Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;

    invoke-interface {v0}, Lcom/nemustech/tiffany/world/TFFlexiblePanel$PointBlender;->onEnd()V

    goto :goto_1
.end method
